import ms from 'ms';

const MONTH = 30.4375;
export default function intervalToMs({ num, unit }) {
	if (unit === 'month') {
		return ms(`${num * MONTH}d`);
	}
	return ms(`${num}${unit}`);
}
